Optimal. Leaf size=33 \[ -\frac {1}{3 (1+\cos (3 x))}-\frac {1}{3} \log (\cos (3 x))+\frac {1}{3} \log (1+\cos (3 x)) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.02, antiderivative size = 33, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 2, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.154, Rules used = {2786, 46}
\begin {gather*} -\frac {1}{3 (\cos (3 x)+1)}-\frac {1}{3} \log (\cos (3 x))+\frac {1}{3} \log (\cos (3 x)+1) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 46
Rule 2786
Rubi steps
\begin {align*} \int \frac {\tan (3 x)}{(1+\cos (3 x))^2} \, dx &=-\left (\frac {1}{3} \text {Subst}\left (\int \frac {1}{x (1+x)^2} \, dx,x,\cos (3 x)\right )\right )\\ &=-\left (\frac {1}{3} \text {Subst}\left (\int \left (\frac {1}{-1-x}+\frac {1}{x}-\frac {1}{(1+x)^2}\right ) \, dx,x,\cos (3 x)\right )\right )\\ &=-\frac {1}{3 (1+\cos (3 x))}-\frac {1}{3} \log (\cos (3 x))+\frac {1}{3} \log (1+\cos (3 x))\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.08, size = 49, normalized size = 1.48 \begin {gather*} \frac {-2 \cos ^2\left (\frac {3 x}{2}\right )+\cos ^4\left (\frac {3 x}{2}\right ) \left (8 \log \left (\cos \left (\frac {3 x}{2}\right )\right )-4 \log (\cos (3 x))\right )}{3 (1+\cos (3 x))^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.08, size = 28, normalized size = 0.85
method | result | size |
derivativedivides | \(-\frac {1}{3 \left (1+\cos \left (3 x \right )\right )}-\frac {\ln \left (\cos \left (3 x \right )\right )}{3}+\frac {\ln \left (1+\cos \left (3 x \right )\right )}{3}\) | \(28\) |
default | \(-\frac {1}{3 \left (1+\cos \left (3 x \right )\right )}-\frac {\ln \left (\cos \left (3 x \right )\right )}{3}+\frac {\ln \left (1+\cos \left (3 x \right )\right )}{3}\) | \(28\) |
risch | \(-\frac {2 \,{\mathrm e}^{3 i x}}{3 \left ({\mathrm e}^{3 i x}+1\right )^{2}}+\frac {2 \ln \left ({\mathrm e}^{3 i x}+1\right )}{3}-\frac {\ln \left ({\mathrm e}^{6 i x}+1\right )}{3}\) | \(38\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.28, size = 27, normalized size = 0.82 \begin {gather*} -\frac {1}{3 \, {\left (\cos \left (3 \, x\right ) + 1\right )}} + \frac {1}{3} \, \log \left (\cos \left (3 \, x\right ) + 1\right ) - \frac {1}{3} \, \log \left (\cos \left (3 \, x\right )\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.40, size = 43, normalized size = 1.30 \begin {gather*} -\frac {{\left (\cos \left (3 \, x\right ) + 1\right )} \log \left (-\cos \left (3 \, x\right )\right ) - {\left (\cos \left (3 \, x\right ) + 1\right )} \log \left (\frac {1}{2} \, \cos \left (3 \, x\right ) + \frac {1}{2}\right ) + 1}{3 \, {\left (\cos \left (3 \, x\right ) + 1\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\tan {\left (3 x \right )}}{\left (\cos {\left (3 x \right )} + 1\right )^{2}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.46, size = 28, normalized size = 0.85 \begin {gather*} -\frac {1}{3 \, {\left (\cos \left (3 \, x\right ) + 1\right )}} + \frac {1}{3} \, \log \left (\cos \left (3 \, x\right ) + 1\right ) - \frac {1}{3} \, \log \left ({\left | \cos \left (3 \, x\right ) \right |}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.37, size = 20, normalized size = 0.61 \begin {gather*} -\frac {\ln \left ({\mathrm {tan}\left (\frac {3\,x}{2}\right )}^2-1\right )}{3}-\frac {{\mathrm {tan}\left (\frac {3\,x}{2}\right )}^2}{6} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________